package api.cherry.feign.factory;

import api.cherry.feign.CrApiHomepageService;
import api.cherry.feign.fallback.CrApiApiErrorLoginServiceImpl;
import api.cherry.feign.CrApiLoginService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author : ms-wang
 * @Version : 1.0.0
 * @ClassName RollbackFactory
 * @Description : 熔断工厂，请求无响应的时候调用这里
 * @Date: 2022/2/7/007 12:20
 */
@Component
public class CrApiLoginServiceFactory implements FallbackFactory<CrApiLoginService> {

    @Override
    public CrApiApiErrorLoginServiceImpl create(Throwable throwable) {
        CrApiApiErrorLoginServiceImpl service = new CrApiApiErrorLoginServiceImpl();
        service.setT(throwable);
        return service;
    }
}
